package sajat.onlab;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.google.android.maps.GeoPoint;

public class User {
	
	private String name;
	private GeoPoint lastplace;
	private Date lastseen;
	
	public User (String name, String latitude, String longitude, String lastseen) {
		this.name = name;
		int lat = Integer.parseInt(latitude);
		int lon = Integer.parseInt(longitude);
		lastplace = new GeoPoint(lat,lon);
		long dat = Long.parseLong(lastseen);
		this.lastseen = new Date(dat);
	}
	
	public String getName() {
		return name;
	}
	
	public GeoPoint getLastPlace() {
		return lastplace;
	}
	
	public String getLastSeen(String dateformat) {
		SimpleDateFormat formatter = new SimpleDateFormat(dateformat);
		return formatter.format(lastseen);
	}
}
